package facilius.controller.action.curso;

import facilius.model.ServiceLocator;
import java.util.Map;
import org.mentawai.core.BaseAction;

/**
 *
 * @author Graciano
 */
public class CursoDeleteAction extends BaseAction{

    @Override
    public String execute() throws Exception {
        String consequence = ERROR;
        try {
            Long id = input.getLong("id");
            Map<String,String> errors = ServiceLocator.getCursoService().validateForDelete(id);

            if (errors != null && errors.get("valido").equalsIgnoreCase("n"))
                output.setValue("errors", errors);
            
            consequence = SUCCESS;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return consequence;
    }

}
